Skip to content

Conversation

@nex3
Copy link
Contributor

@nex3 nex3 commented Dec 1, 2025

@nex3 nex3 force-pushed the css-if branch 3 times, most recently from dc3b5bf to bf34802 Compare December 1, 2025 23:47
@nex3 nex3 requested a review from jathak December 3, 2025 04:43
@nex3 nex3 marked this pull request as ready for review December 3, 2025 04:49
IfExpression(
Iterable<(IfConditionExpression?, Expression)> branches, this.span)
: branches = List.unmodifiable(branches) {
if (this.branches.isEmpty) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if() with not branches is considered a valid (if not useful) plain CSS expression, at least according to MDN. Is the decision to require at least one branch in Sass intentional here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe MDN is inaccurate in this case. The spec defines the syntax as

<if()> = if( [ <if-branch> ; ]* <if-branch> ;? )

which clearly requires at least one branch.

nex3 added 3 commits December 8, 2025 10:33
This makes it easier for the migrator to handle functions with named
arguments.
@nex3 nex3 merged commit 2abc89e into main Dec 8, 2025
39 checks passed
@nex3 nex3 deleted the css-if branch December 8, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants